package demo1223.pm;

import java.io.File;
import java.io.IOException;

public class Demo_Fuxi {
    public static void main(String[] args) {
        File file = new File("a\\aa\\b");
        boolean b = file.mkdirs();
        System.out.println(b);//"a\aa\b"
        System.out.println(file.getPath());
        System.out.println(file.getName());
    }

    public static void demo01(File file) {
        //创建父目录
        file.getParentFile().mkdirs();
        try {
            if (file.getParentFile().exists()) {
                boolean b = file.createNewFile();
                System.out.println(b);
            } else {
                System.out.println("父目录不存在");
            }
        } catch (IOException e) {
            System.out.println("出现异常");
            System.out.println(e);
        }
        System.out.println("程序结束");
    }
}
